package com.motorola.dp.jenkinsmonitor.service.util.dom;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

import com.motorola.dp.jenkinsmonitor.model.util.exception.ConversionException;

/**
*
* This class converts DOM objects to their corresponding classes
* by using DOM mapping annotations
*
*/
public interface DomConversionService {

    /**
    *
    * Converts a DOM Document into POJO
    *
    * @param domNode
    * @param model annotated POJO class
    * @return POJO instance
    * @throws ConvertionException
    *
    */
    <T> T convert(Document domDocument, Class<T> model) throws ConversionException;

    /**
     *
     * Converts a DOM Node into POJO
     *
     * @param domNode
     * @param model annotated POJO class
     * @return POJO instance
     * @throws ConvertionException
     *
     */
   <T> T convert(Element domNode, Class<T> model) throws ConversionException;

}
